import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'vscode-icons:file-type-rss',
      order: 8888,
      title: $t('page.subscribe.title'),
      authority: ['super'], // 角色码 roles
    },
    name: 'Sub',
    path: '/sub',
    children: [
      {
        name: 'subDrama',
        path: '/sub/drama',
        component: () => import('#/views/sub/drama/index.vue'),
        meta: {
          icon: 'catppuccin:video',
          title: $t('page.subscribe.drama'),
          keepAlive: true,
        },
      },
      {
        name: 'dramaDetails',
        path: '/sub/drama/:id',
        component: () => import('#/views/sub/drama/details/index.vue'),
        meta: {
          hideInMenu: true,
          hideInTab: true,
          title: $t('page.subscribe.dramaDetails'),
        },
      },
      {
        name: 'dramaShares',
        path: '/sub/drama/:id/:sid/:name/:sname',
        component: () => import('#/views/sub/drama/shares/index.vue'),
        meta: {
          hideInMenu: true,
          hideInTab: true,
          title: $t('page.subscribe.dramaShares'),
        },
      },
    ],
  },
];

export default routes;
